import request from '@/router/axios';
import { baseUrl } from '@/config/env';


export const addRoles = (list) => request({
  url: baseUrl + '/api/roles',
  method: 'post',
  data: list
});

export const eidtRoles = (list) => request({
  url: baseUrl + '/api/roles',
  method: 'put',
  data: list
});
export const dletRoles = (list) => request({
  url: baseUrl + '/api/roles',
  method: 'delete',
  data: list
});
export const refreshToken = () => request({
  url: baseUrl + '/user/refresh' ,
  method: 'post'
})

export const getMenu = (data) => request({
  url: baseUrl + '/api/roles',
  method: 'get',
  params: data
});

export const getTopMenu = () => request({
  url: baseUrl + '/user/getTopMenu',
  method: 'get'
});

export const sendLogs = (list) => request({
  url: baseUrl + '/user/logout',
  method: 'post',
  data: list
})

export const logout = () => request({
  url: baseUrl + '/user/logout',
  meta: {
    isToken: false
  },
  method: 'get'
})